package com.xrit.ssm.controller;

import com.github.pagehelper.PageInfo;
import com.xrit.ssm.constant.MessageConstant;
import com.xrit.ssm.entity.PageResult;
import com.xrit.ssm.entity.QueryPageBean;
import com.xrit.ssm.entity.Result;
import com.xrit.ssm.pojo.UserInfo;
import com.xrit.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 类名称: UserController
 * 类描述:TODO
 * 创建人: czb
 * 创建时间:2022/8/11 下午 03:23
 * Version 1.0.0
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/findPage")
    public Result findPage(@RequestBody QueryPageBean queryPageBean){
       PageInfo<UserInfo> list= userService.findPage(queryPageBean);
       return new Result(true, MessageConstant.QUERY_USER_SUCCESS,new PageResult(list.getTotal(),list.getList()));
    }
}
